public function all(){
	<volist name="searchFieldArr" id="v">
            <if condition="$v['inType'] eq 'text'">
            	${$key}=I('{$key}','','htmlspecialchars');
           	<else/>
	            <if condition="$v['inType'] eq 'select'">
		            <if condition="isset($v['option_val_type']) AND $v['option_val_type'] eq 'char'">
		            	${$key}=I('{$key}','','htmlspecialchars');
		           	<else/>
			           	<if condition="isset($v['default']) AND !empty($v['default'])">
		            		${$key}=I('{$key}',{$v['default']},'intval');	
			           	<else/>
		            		${$key}=I('{$key}',0,'intval');	
			           	</if>
		           	</if>  	           	
	           	<else/>
	           		<if condition="$v['inType'] eq 'datetime'">
		                $t1=I('t1','','htmlspecialchars');
		                $t2=I('t2','','htmlspecialchars'); 	           			
	           		</if>
	           	</if>           		
           	</if>	
	</volist>
	<php>echo "\r\n\t\t\t";</php>
    $optype =I('optype','query','htmlspecialchars');

	$where=array(); 

	<volist name="searchFieldArr" id="vv">
            <if condition="$vv['inType'] eq 'text'">
                if(${$key}!=''){
                	$where['{$key}']=array('like','%'.${$key}.'%'); 
                }            	
           	<else/>
	            <if condition="$vv['inType'] eq 'select'">
		            <if condition="isset($vv['option_val_type']) AND $vv['option_val_type'] eq 'char'">
		                if(${$key}!=''){
		                	$where['{$key}']=${$key}; 
		                }  		            	
		           	<else/>
			           	<if condition="isset($vv['default']) AND !empty($vv['default'])">
			                if(${$key}!={$vv['default']}){
			                	<if condition="isset($tableInfoArray2[$key]) && ($tableInfoArray2[$key] eq 'enum')">
			                		$where['{$key}']="${$key}"; 
			                	<else/>
			                		$where['{$key}']=${$key}; 
			                	</if>
			                } 		            		
			           	<else/>
			                if(!empty(${$key})){
			                	$where['{$key}']=${$key}; 
			                }		            			
			           	</if>
		           	</if>  	           	
	           	<else/>
	           		<if condition="$vv['inType'] eq 'datetime'">
		                <if condition="$vv['dataType'] eq 'int'">
		                       $t1=strtotime($t1);
		                       $t2=strtotime($t2); 		                	
		                </if>

		                if($t1!='' && $t2!=''){
		                    $where['{$key}']=array(array('gt',$t1),array('lt',$t2)); 
		                }else{
			                if($t1!=''){
			                	$where['{$key}']=array('gt',$t1); 
			                }
			                if($t2!=''){
			                	$where['{$key}']=array('lt',$t2); 
			                }                 	
		                } 
	           		</if>
	           	</if>           		
           	</if>	
	</volist>


	${$tableName}Model = D('{$TableName}');

	    
	$count = ${$tableName}Model->where($where)->count();
	$Page = new Page($count,15);	//实例化分页类 传入总记录数和每页显示的记录数(15)
	$show = $Page->show();	//分页显示输出
	${$tableName}List = ${$tableName}Model->where($where)->order('{$primaryKey} desc');
    if($optype != 'export'){
		${$tableName}List =${$tableName}List->limit($Page->firstRow.','.$Page->listRows);
    }

	${$tableName}List =${$tableName}List->select();	//分页查询

    if($optype == 'export'){
        $filename = "{$pageBreadCrumbs}";
        $title = [<if condition="count($listFieldArr) AND is_array($listFieldArr)"><volist name="listFieldArr" id="vvo" key="iio"><volist name="tableInfoArray" id="tableInfo"><if condition="$tableInfo[$columnNameKey] eq $vvo"><if condition="$iio gt 1">,</if><if condition="count($fieldAliasArr) AND isset($fieldAliasArr[$tableInfo[$columnNameKey]]) AND ($fieldAliasArr[$tableInfo[$columnNameKey]] neq '')">'{$fieldAliasArr[$tableInfo[$columnNameKey]]}'<else/><if condition="$tableInfo['column_comment'] neq ''">'{$tableInfo[column_comment]}'<else/>'{$tableInfo[$columnNameKey]}'</if></if></if></volist></volist></if>];
        $export = array();
        foreach(${$tableName}List as $key=>$value){
        	<if condition="count($listFieldArr) AND is_array($listFieldArr)">
        		<volist name="listFieldArr" id="vvo">
					<volist name="tableInfoArray" id="tableInfo"> 
							<if condition="$tableInfo[$columnNameKey] eq $vvo">
                                <if condition="isset($formFieldArr[$tableInfo[$columnNameKey]])">
	                                 <if condition="isset($formFieldArr[$tableInfo[$columnNameKey]]['inType']) && $formFieldArr[$tableInfo[$columnNameKey]]['inType']=='select'">
                                          $export[$key]['{$tableInfo[$columnNameKey]}'] = func_select_data_checkedval('{$moduleName}','{$TableName}','{$tableInfo[$columnNameKey]}',$value['{$tableInfo[$columnNameKey]}']);  
	                                 <elseif condition="isset($formFieldArr[$tableInfo[$columnNameKey]]['inType']) && $formFieldArr[$tableInfo[$columnNameKey]]['inType']=='radio'" />
                                          $export[$key]['{$tableInfo[$columnNameKey]}'] = func_select_data_checkedval('{$moduleName}','{$TableName}','{$tableInfo[$columnNameKey]}',$value['{$tableInfo[$columnNameKey]}']); 		                                                          
	                                 <elseif condition="isset($formFieldArr[$tableInfo[$columnNameKey]]['inType']) && $formFieldArr[$tableInfo[$columnNameKey]]['inType']=='datetime'" />
                                          <eq name="formFieldArr[$tableInfo[$columnNameKey]]['dataType']" value="int">
                                               $export[$key]['{$tableInfo[$columnNameKey]}'] = date('Y-m-d H:i:s',$value['{$tableInfo[$columnNameKey]}']);  
                                          <else/>
											$export[$key]['{$tableInfo[$columnNameKey]}'] = $value['{$tableInfo[$columnNameKey]}'];  
                                          </eq>										                                
	                                 <else/>
											$export[$key]['{$tableInfo[$columnNameKey]}'] = $value['{$tableInfo[$columnNameKey]}'];  
	                                 </if>                                                          
                                <else/>
									$export[$key]['{$tableInfo[$columnNameKey]}'] = $value['{$tableInfo[$columnNameKey]}'];  
                                </if>
                               <php>echo "\r\n\t\t\t";</php>								
							</if>              
					</volist>
			    </volist>
			</if>
        }
        array_unshift($export,$title); 
        create_xls($export,$filename);
        exit;
    }


	$this->assign('page',$show);	//赋值分页输出
	$this->assign('{$tableName}List', ${$tableName}List);
	$this->display();
}